package com.xxhui.serializationdemo;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.TextView;

import com.xxhui.serializationdemo.module.Student;

public class ShowDateActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        Student studentP = intent.getParcelableExtra("studentP");
        com.xxhui.serializationdemo.modules.Student studentS = (com.xxhui.serializationdemo.modules.Student) intent.getSerializableExtra("studentS");
        TextView textView  = new TextView(this);
        textView.setText(studentP.toString());
        textView.append("\n");
        textView.append(studentS.toString());
        textView.setTextColor(Color.RED);
        textView.setBackgroundColor(Color.GRAY);

        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        params.width = WindowManager.LayoutParams.MATCH_PARENT;
        params.height = WindowManager.LayoutParams.MATCH_PARENT;

        setContentView(textView,params);
    }
}
